<extend name="./Common/View/Public/list.html" />

<block name="page_title">指标列表</block>
<block name="search">
    <div class="layui-input-inline">
        <select name="tpl_id" id="tpl_id" lay-filter="tpl_id" api="rate/Template/slist" empty="模板"></select>
    </div>
    <div class="layui-input-inline">
        <select name="status" id="status" lay-filter="status" api="sys/Dict/info/code/STATUS" empty="状态"></select>
    </div>
    <div class="layui-input-inline">
                <input class="layui-input" name="keywords" autocomplete="off" placeholder="名称" />
    </div>
</block>

<block name="toolbar">
    {:W('Todo/UI/toolbar',array('指标',array('add','delete','enable','disable')))}
</block>

<block name="main">
    <script type="text/javascript">
        var list = {api:"{$Think.const.MODULE_NAME}/{$Think.const.CONTROLLER_NAME}/"};
        list.columns =  [[
            {checkbox: true, fixed: true}
            , {field:'title', minWidth:100, title : '指标名称'}
            , {field:'pid', minWidth:150, title : '上级指标', sort: true, templet: '#tpl_norm'}
            , {field:'app_id', minWidth:150, title : '所属模板', sort: true, templet: '#tpl_template'}
            , {field: 'score', title: '分数', width: 80}
            , {field: 'way', title: '打分方式', width: 120, templet: '#tpl_way'}
            , {field: 'sort', title: '排序', width: 80, sort: true}
            ,{fixed: 'right', minWidth:80, align:'center', toolbar: '#tpl_bar'}
        ]];
    </script>
    <script type="text/html" id="tpl_bar">
        {{ format_optbar(['edit','delete']) }}
    </script>
    <script type="text/html" id="tpl_template">
        {{ format_data_template(d.tpl_id) }}
    </script>
    <script type="text/html" id="tpl_norm">
        {{ format_data_norm(d.pid) }}
    </script>
    <script type="text/html" id="tpl_way">
        {{ format_rate_way(d.way) }}
    </script>
</block>
<block name="script">
    <script src="/api/Rate/Template/format"></script>
    <script src="/api/Rate/Norm/format"></script>
</block>